package com.srit.migration.business.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

import com.srit.base.bean.Page;
import com.srit.base.dao.SqlMapDao;
import com.srit.migration.business.bean.DbUser;
import com.srit.migration.business.dao.DbUserDao;

/**
 * @author guan
 * @by daoImpl.tem
 * 
 */
 @Service
public class DbUserDaoImpl implements DbUserDao {
	@Autowired(required = true)
	private SqlMapDao sqlMapDao;

	@Override
	public void save(DbUser dbUser) {
		sqlMapDao.save("DbUser.save", dbUser);
	}

	@Override
	public void update(DbUser dbUser) {
		sqlMapDao.update("DbUser.save", dbUser);
	}

	@Override
	public DbUser getById(DbUser dbUser) {
		return (DbUser) sqlMapDao.getById("DbUser.getById", dbUser.getId());
	}

	@Override
	public void delete(DbUser dbUser) {
		sqlMapDao.delete("DbUser.delete", dbUser);
	}

	@Override
	public void page(Page page) {
		sqlMapDao.queryForObject("DbUser.page", page);
	}
	
	@Override
	public void batchSave(List<DbUser> dbUserList) {
		sqlMapDao.batchSave("DbUser.batchSave", dbUserList);

	}

	@Override
	public List list(Page page) {
		return sqlMapDao.queryForList("DbUser.list", page);

	}

}
